<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="width=750,viewport-fit=cover,user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-capable">
<meta content="black" name="apple-mobile-web-status-bar-style">
<title>我的订单</title>
<link rel="stylesheet" type="text/css" href="../css/orderList.css" />
</head>
<body>
<div id="app" >
	<div v-for="order in orderList" class="tabelviewcell">
		<div style="margin-left: 10px;">
			<label class="orderNoLabel">订单号:{{order.orderNumber}}</label><hr/><br/>
			<label class="stateLabel" v-if="order.remark8 == '0'">{{order.remark5 == 0?'待发货':'已发货'}}</label>
			<div class="orderinfoView">
				<img style="max-width: 150px;max-height: 150px; padding-bottom: 15px" :src="order.remark"/>
				<div class="labelViews">
					<label class="goodsNameLabel">{{order.title}}</label>
					<div style="display: flex">
						<label class="priceLabel">不凡币:　{{order.remark10}}</label>
						<label class="count">X 1</label>
					</div>
				</div>
			</div>
			<hr/>
			<div style="display: flex;width: 100%">
				<div style="width: 100%">兑换时间:{{order.createTime | formatDate}}</div>
				<div style="position:absolute;left: 500px">不凡币合计:　{{order.price}}</div>
			</div>
			<div v-if="order.remark6 != null">
				<div>快递公司:{{order.remark6}}</div>
				<div>快递单号:{{order.remark7}}</div>
			</div>
		</div>
	</div>
	<div v-show="orderList.length == 0">
		<img src='../image/none.jpg' style='width: 300px;height:300px;margin-left: 225px;margin-top:100px;'>
	</div>
</div>
</body>
<script type="text/javascript" src="../js/jquery-3.4.1.js"></script>
<script type="text/javascript" src="../js/vue.js"></script>
<script type="text/javascript" src="../js/request.js"></script>
</html>

<script type="text/javascript">
	new Vue({
		el:'#app',
		data:{
			orderList:[],
		},
		filters: {
			formatDate:function (value) {
				var date = new Date(value);
				var year = date.getFullYear();
				var month = padDate(date.getMonth()+1);
				var day = padDate(date.getDate());
				var hours = padDate(date.getHours());
				var minutes = padDate(date.getMinutes());
				var seconds = padDate(date.getSeconds());
				//var week = padDate(date.getDay());
				let week = new Date(value).getDay();
				let weeks = ["日","一","二","三","四","五","六"];
				//let getWeek = "星期" + weeks[week];
				return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
			}
		},
		methods:{
			//获取广告列表
			getOrderList(){
				var _this = this;
				ajaxPost("../orderController/orderList",{}, function (result) {
					_this.orderList = result;
				});
			},
		},
		mounted(){
			this.getOrderList();
			console.log("挂载完成生命周期");
		},
	})

	var padDate = function (value) {
		return value <10 ? '0' + value:value;
	};
</script>
